local blaze = require "blaze"
local app = require "app"

local game = app.game.running
local consts = game.util.consts

local M = game.ui.element()

M.store_watchers = {
    gameplay = {
        ["$"] = blaze.noop,

        ["恢复游戏场景"] = function(self, store, state, args)
            if not state.scene then
                return
            end
            if state.scene.phase_id > consts.PHASE_BET then
                self:show()
            else
                self:hide()
            end
        end,

        ["阶段变更"] = function(self, store, state, args)
            if state.phase_id == consts.PHASE_IDLE or state.phase_id == consts.PHASE_BET then
                self:hide()
            end
        end
    }
}

function M:ctor(ingame)
    self.ingame = ingame
    self.res = "club.threecard.baccaratlib/ui/common.b:resumer"
end

return M